<template>
    <div>
        <el-menu
                :default-active="ActiveIndex"
                class="el-menu-demo"
                mode="horizontal"
                active-text-color="#84A9AC"
                router
        >
            <el-menu-item
                    v-for="(item,index) in setNavData"
                    :key="index"
                    :index=item.path
                    @click="getRouter(item.path,item.name)"
            >
                <span slot="title">{{item.name}}</span>
            </el-menu-item>
        </el-menu>
        <router-view></router-view>
    </div>
</template>

<script>
    import {mapActions} from 'vuex'
    export default {
        name: "SetNav",
        data(){
            return{
                setNavData:[
                    {path:'/Main/Set/CompanyInformation',name:'公司信息'},
                    {path:'/Main/Set/ReceivingInformation',name:'收货信息管理'},
                    {path:'/Main/Set/OperationLog',name:'操作日志'},
                    {path:'/Main/Set/SharingSettings',name:'分享设置'},
                ],
            }
        },
        methods: {
            ...mapActions(['routerFun']),
            getRouter(path,name) {
                let obj = {path,name}
                this.routerFun(obj)
            }
        },
        computed: {
            ActiveIndex: {
                get: function () {
                    return this.$route.path;

                },
                set: function () {

                }
            },
        }

    }
</script>

<style scoped>

</style>